Skip to contentSkip to conversation

Only index.html is cloned in private repo clone recipe #yocto

DISCUSSION Bel Hadj Salem Talel 3 participants 5 messages Oct 7, 2020 – Oct 8, 2020

lore
Share & tools
lore
#0 lore raw

Hello All,

I have a private git repo which is in a local gitlab server.
Here is the local repo domain: http://gitlab.tools.comp.local/comp/sense/sense_frontend
I already saved the git credentials (username and password) , and I created this recipe:

LICENSE = "CLOSED"
SRCURL = "http://gitlab.tools.comp.local/ comp /sense/sense_frontend" SRCBRANCH = "master"
SRCPROTO = "https"
# Define the source for this recipe
SRC_URI += " ${ SRCURL} ;protocol= ${ SRCPROTO} ;branch= ${ SRCBRANCH} " SRC_URI[md5sum] = "1becf51a6312d09f0c1c22120efd499c"
SRC_URI[sha256sum] = "142e3af77b6851b614d07012abce145ce2526b8d0d95e7a94cff62f0e6432d26"

When I do do_fetch and do_unpack I only see the index.html file of the repo is downloaded. What is the problem ?
How can I solve this?

Thanks, Talel

#1 lore raw
Quoted 16 lines · Bel Hadj Salem Talel

Hello All,

I have a private git repo which is in a local gitlab server.
Here is the local repo domain: http://gitlab.tools.comp.local/comp/sense/sense_frontend
I already saved the git credentials (username and password) , and I created this recipe:

LICENSE = "CLOSED"
SRCURL = "http://gitlab.tools.comp.local/comp/sense/sense_frontend" SRCBRANCH = "master"
SRCPROTO = "https"
# Define the source for this recipe
SRC_URI += "${SRCURL};protocol=${SRCPROTO};branch=${SRCBRANCH}" SRC_URI[md5sum] = "1becf51a6312d09f0c1c22120efd499c"
SRC_URI[sha256sum] = "142e3af77b6851b614d07012abce145ce2526b8d0d95e7a94cff62f0e6432d26"

Quoted 3 lines

When I do do_fetch and do_unpack I only see the index.html file of the repo is downloaded. What is the problem ?
How can I solve this?

SRC_URI should start with "git://" to do a git clone. The "protocol" field can then be set to http, https or ssh if needed, I see you've already got that set to https after expansion so you should just need to change your SRCURL value.

Thanks,

Signature · 2 lines
Paul Barker
Konsulko Group
#2 lore raw

Hi,
Thanks for the quick reply ,
Actually I was wrong about https, I changed it to http and added: SRCURL = " git://gitlab.tools.comp.local/comp/sense/sense_frontend" ( http://gitlab.tools.comp.local/comp/sense/sense_frontend" ) instead of SRCURL = " http://gitlab.tools.comp.local/comp/sense/sense_frontend"

Now when I do_fetch:

############
ERROR: sense-web-1.0-r0 do_fetch:
Fetcher failure for URL: 'git://gitlab.tools. comp ( http://gitlab.tools.comp.local/comp/sense/sense_frontend" ).local/ comp ( http://gitlab.tools.comp.local/comp/sense/sense_frontend" ) /sense/sense_frontend;protocol=http;branch=master'. Please set a valid SRCREV for url ['SRCREV_default_pn-sense-web', 'SRCREV_default', 'SRCREV_pn-sense-web', 'SRCREV']
(possible key names are git://gitlab.tools. comp ( http://gitlab.tools.comp.local/comp/sense/sense_frontend" ).local/ comp ( http://gitlab.tools.comp.local/comp/sense/sense_frontend" ) /sense/sense_frontend;protocol=http;branch=master, or use a ;rev=X URL parameter)
############

I'm trying to understand the issue for my Yocto knowledge. Can you help me understand this or fix the issue ?

Thanks alot for the help.

#3 lore raw
Quoted 13 lines · Bel Hadj Salem Talel

Thanks for the quick reply ,
Actually I was wrong about https, I changed it to http and added: SRCURL = "git://gitlab.tools.comp.local/comp/sense/sense_frontend" instead of SRCURL = "http://gitlab.tools.comp.local/comp/sense/sense_frontend"

Now when I do_fetch:

############
ERROR: sense-web-1.0-r0 do_fetch:
Fetcher failure for URL: 'git://gitlab.tools.comp.local/comp/sense/sense_frontend;protocol=http;branch=master'. Please set a valid SRCREV for url ['SRCREV_default_pn-sense-web', 'SRCREV_default', 'SRCREV_pn-sense-web', 'SRCREV'] (possible key names are git://gitlab.tools.comp.local/comp/sense/sense_frontend;protocol=http;branch=master, or use a ;rev=X URL parameter)
############

Quoted 2 lines

I'm trying to understand the issue for my Yocto knowledge. Can you help me understand this or fix the issue ?

The git fetcher needs to know what SHA to unpack. You haven't set SRCREV, you can either set it to the specific SHA or to "${AUTOREV}" if you want it to refetch every time it builds.

Note that the [md5sum] and [sha256sum] flags are only needed for HTTP downloads, so you can delete these lines.

Ross

#4 lore raw

Thanks for the support,
Here what I tried and it worked:

Quoted 4 lines
Quoted 8 lines

*BRANCH = "master"*
*PROTOCOL = "http"
* *SRCREPO = "gitlab.tools.comp.local/comp/sense/sense_frontend.git"
* *SRC_URI = "git://${* **SRCREPO}* ; protocol=${PROTOCOL}; branch=${BRANCH}"
* *SRCREV = "${AUTOREV}"*

And now everything is fetched and then unpacked into ${S}/git correctly.

Thanks, Talel